package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.dto.SetmealDTO;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {
    @Select("select count(*) from setmeal where  category_id = #{id}")
    Integer countByCategoryId(Integer id);

    Page<SetmealVO> setmealPageQuery(SetmealPageQueryDTO dto);
    @AutoFill(OperationType.INSERT)
    void saveSetmeal(Setmeal setmeal);

    void deleteSetmeal(List<Long> ids);
    @AutoFill(OperationType.UPDATE)
    void updataSetmeal(Setmeal setmeal);
@Select("SELECT * from setmeal where id = #{id}")
    SetmealVO getByid(Long id);

    List<SetmealVO> getByIds(List<Long> ids);
}


